package test38;

import java.io.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ws
 * Date: 2023-05-10
 * Time: 11:12
 */
//https://www.nowcoder.com/practice/ed9bc679ea1248f9a3d86d0a55c0be10?tpId=143&tqId=33928&ru=/exam/oj
//这个题目并不困难，只需要生成一个n*m的地图，首先将有蘑菇的该点设置为-1，表示不能碰到蘑菇，那么从<1, 1>出发，
// 可达<1, 1>的概率就是map[1][1] = 1,对于一般情况，map[i][j] = (map[i][j-1] + map[i-1][j]) / 2，
// 其中，如果map[i][j]、 map[i][j-1]、 map[i-1][j]如果分别为-1， 则不计算对应部分，不过，对于i==n和j==m的情况下有所不同，
// 因为此时只有一种移动方式，所以应该在多加上map[i][j-1]/2和map[i-1][j]/2，由此，map[n][m]就是达到终点的概率
public class Main1 {
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        String str = null;
        while ((str = br.readLine()) != null) {
            //2 2 1
            //2 1
            String[] strs = str.split(" ");
            int row = Integer.parseInt(strs[0]);
            int col = Integer.parseInt(strs[1]);
            int n = Integer.parseInt(strs[2]);
            strs = new String[n];
            for (int i = 0; i < n; i++) {
                strs[i] = br.readLine();
            }
            double[][] arr = new double[row + 1][col + 1];
            arr[1][1] = 1;
            for (int i = 0; i < n; i++) {
                String[] temp = strs[i].split(" ");
                arr[Integer.parseInt(temp[0])][Integer.parseInt(temp[1])] = -1;
            }
            for (int i = 1; i <= row; i++) {
                for (int j = 1; j <= col; j++) {
                    if (arr[i][j] != -1) {
                        if (arr[i][j - 1] != -1) {
                            arr[i][j] += i == row ? arr[i][j - 1] : arr[i][j - 1] / 2;
                        }
                        if (arr[i - 1][j] != -1) {
                            arr[i][j] += col == j ? arr[i - 1][j] : arr[i - 1][j] / 2;
                        }
                    }
                }
            }
            System.out.printf("%.2f", arr[row][col]);
            System.out.println();
        }
    }
}
